home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C/C++ Users Group Library 1996 July
/
C-C++ Users Group Library July 1996.iso
/
listings
/
v_07_02
/
v7n2072a.txt
< prev
next >
Wrap
Text File
|
1988-12-10
|
2KB
|
63 lines
========
FIGURE 2
========
getl()
{
if (length == 1) {
/* rule 1 */
addch(c):refresh();
str[i] = c;
break;
}
else {
if (c == '\n') {
/* rule 2 */
break;
}
else {
if (c == BACKSPACE) {
if (i == 0) {
/* rule 3 */
beep();
}
else {
/* rule 4 */
backup(1);
}
}
else {
if (i == length) {
/* rule 5 */
beep();
}
else {
if (typ == NUMERIC) {
if (isdigit(c)) {
/* rule 6 */
addch(c):refresh();
str[i] = c;
str[i+1] = 0;
i++;
}
else {
/* rule 7 */
beep();
}
}
else {
/* rule 8 */
addch(c):refresh();
str[i] = c;
str[i+1] = 0;
i++;
}
}
}
}
}
}